import request from '@/config/axios'

// 线路实践点关联 VO
export interface SpotRelationVO {
  id: number // 自增主键
  roadId: number // 线路id
  spotId: number // 实践点
  spotDeptId: number // 实践点部门id
}

// 线路实践点关联 API
export const SpotRelationApi = {
  // 查询线路实践点关联分页
  getSpotRelationPage: async (params: any) => {
    return await request.get({ url: `/road/spot-relation/page`, params })
  },

  // 查询线路实践点关联详情
  getSpotRelation: async (id: number) => {
    return await request.get({ url: `/road/spot-relation/get?id=` + id })
  },

  // 新增线路实践点关联
  createSpotRelation: async (data: SpotRelationVO) => {
    return await request.post({ url: `/road/spot-relation/create`, data })
  },

  // 修改线路实践点关联
  updateSpotRelation: async (data: SpotRelationVO) => {
    return await request.put({ url: `/road/spot-relation/update`, data })
  },

  // 删除线路实践点关联
  deleteSpotRelation: async (id: number) => {
    return await request.delete({ url: `/road/spot-relation/delete?id=` + id })
  },

  // 导出线路实践点关联 Excel
  exportSpotRelation: async (params) => {
    return await request.download({ url: `/road/spot-relation/export-excel`, params })
  }
}